/**
 * 两阶段上传对话框样式
 */

.two-stage-upload-dialog {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.two-stage-upload-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.two-stage-upload-content {
    position: relative;
    background: #2a2a2a;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.two-stage-upload-content.stage-two {
    max-width: 1000px;
}

/* 📌 更灵活的尺寸选项 - 可按需使用 */
.two-stage-upload-content.extra-wide {
    width: 95%;
    max-width: 1400px;
}

.two-stage-upload-content.full-wide {
    width: 98%;
    max-width: 1800px;
}

.two-stage-upload-header {
    padding: 24px;
    border-bottom: 1px solid #444;
    background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
}

.two-stage-upload-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    position: relative;
}

.header-left {
    flex: 1;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.two-stage-upload-header h2 {
    margin: 0;
    font-size: 20px;
    color: #fff;
}

.close-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: #888;
    font-size: 24px;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
}

.close-btn:hover {
    background: #333;
    color: #fff;
}

.global-control {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    background: #1a1a1a;
    border-radius: 6px;
    border: 1px solid #333;
}

.global-label {
    color: #ccc;
    font-size: 14px;
    white-space: nowrap;
}

.two-stage-upload-body {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
}

.two-stage-upload-body::-webkit-scrollbar {
    width: 8px;
}

.two-stage-upload-body::-webkit-scrollbar-track {
    background: #1a1a1a;
}

.two-stage-upload-body::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 4px;
}

.two-stage-upload-body::-webkit-scrollbar-thumb:hover {
    background: #666;
}

.two-stage-upload-footer {
    padding: 16px 24px;
    border-top: 1px solid #444;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.footer-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.footer-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* 第一阶段：文件上传 */

/* 拖拽提示层 - 动态显示 */
.upload-drag-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    pointer-events: all;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.drag-hint-content {
    text-align: center;
    padding: 60px;
    border: 3px dashed #4a9eff;
    border-radius: 16px;
    background: rgba(74, 158, 255, 0.1);
    min-width: 400px;
}

.drag-icon {
    font-size: 72px;
    margin-bottom: 20px;
    animation: bounce 1s ease infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.drag-text {
    font-size: 24px;
    font-weight: bold;
    color: #fff;
    margin: 16px 0;
}

.drag-hint {
    font-size: 16px;
    color: #aaa;
    margin: 8px 0;
}

/* 空状态提示 */
.upload-empty-hint {
    text-align: center;
    padding: 60px 40px;
    color: #888;
}

.upload-empty-hint .empty-icon {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.6;
}

.upload-empty-hint p {
    margin: 8px 0;
    font-size: 15px;
    color: #aaa;
}

.upload-empty-hint .hint-text {
    font-size: 13px;
    color: #666;
}

.upload-file-list {
    margin-top: 24px;
}

.upload-file-list h3 {
    margin: 0 0 16px 0;
    color: #fff;
    font-size: 16px;
}

.upload-file-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #1a1a1a;
    border-radius: 6px;
    margin-bottom: 8px;
}

.upload-file-item .file-name {
    flex: 1;
    color: #fff;
    font-size: 14px;
}

.upload-file-item .file-size {
    color: #888;
    font-size: 13px;
}

.upload-file-item .file-status {
    color: #4a9eff;
    font-size: 13px;
    min-width: 120px;
    text-align: right;
}

/* 材质解析和审核区域 */

.material-review-section {
    margin-top: 24px;
    padding: 20px;
    background: linear-gradient(135deg, #1a1f2e 0%, #1a1a1a 100%);
    border-radius: 8px;
    border: 1px solid #4a9eff;
    box-shadow: 0 2px 8px rgba(74, 158, 255, 0.1);
}

.review-summary {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.summary-title {
    color: #4a9eff;
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.summary-items {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.summary-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: rgba(42, 42, 42, 0.6);
    border-radius: 4px;
    border: 1px solid #333;
}

.summary-label {
    color: #ccc;
    font-size: 13px;
}

.summary-value {
    color: #fff;
    font-size: 14px;
    font-weight: 600;
}

.summary-value.success {
    color: #4caf50;
}

.summary-value.warning {
    color: #ff9800;
}

/* 新增按钮样式 */

.btn-upload {
    background: #4a9eff;
    color: #fff;
}

.btn-upload:hover:not(:disabled) {
    background: #3a8eef;
    box-shadow: 0 2px 8px rgba(74, 158, 255, 0.3);
}

.btn-header {
    padding: 8px 20px;
    font-size: 13px;
}

.btn-analyze {
    background: #667eea;
    color: #fff;
}

.btn-analyze:hover:not(:disabled) {
    background: #556dd9;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.btn-review {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    font-weight: 600;
}

.btn-review:hover:not(:disabled) {
    background: linear-gradient(135deg, #556dd9 0%, #653a91 100%);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
}

/* 第二阶段：材质匹配 */

.material-match-list {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.no-matches {
    padding: 40px;
    text-align: center;
    color: #888;
    font-size: 14px;
}

/* 审核窗口底部提示 */
.material-review-dialog .footer-hint {
    flex: 1;
    color: #888;
    font-size: 13px;
    display: flex;
    align-items: center;
}

/* 模型分类 */

.models-category {
    background: #1a1a1a;
    border-radius: 8px;
    padding: 20px;
}

/* 材质分类（新增：按材质分组） */

.materials-category {
    background: #1a1a1a;
    border-radius: 8px;
    padding: 20px;
}

.category-title {
    margin: 0 0 16px 0;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    border-bottom: 1px solid #333;
    padding-bottom: 12px;
}

.category-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* 模型项 */

.model-item {
    background: #2a2a2a;
    border-radius: 6px;
    border: 1px solid #333;
    overflow: hidden;
    transition: all 0.2s ease;
}

.model-item.expanded {
    border-color: #4a9eff;
}

.model-header {
    padding: 16px;
    cursor: pointer;
    user-select: none;
    transition: all 0.2s ease;
}

.model-header:hover {
    background: #333;
}

.model-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.expand-icon {
    color: #888;
    font-size: 12px;
    width: 16px;
    transition: transform 0.2s ease;
}

.model-name {
    color: #fff;
    font-size: 15px;
    font-weight: 500;
    flex: 1;
}

.model-stats {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #888;
    font-size: 13px;
}

.match-badge {
    background: #4a9eff;
    color: #fff;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 500;
}

.model-content {
    border-top: 1px solid #333;
    padding: 16px;
    background: #222;
}

.mesh-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Mesh 项 */

.mesh-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    background: #2a2a2a;
    border-radius: 4px;
    border: 1px solid #333;
    transition: all 0.2s ease;
}

.mesh-item:hover {
    background: #333;
    border-color: #4a9eff;
}

.mesh-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.mesh-name {
    color: #fff;
    font-size: 14px;
    font-weight: 500;
}

.material-name {
    color: #aaa;
    font-size: 13px;
}

.material-match {
    color: #4a9eff;
    font-size: 13px;
}

.material-no-match {
    color: #888;
    font-size: 13px;
}

.mesh-status {
    display: flex;
    align-items: center;
}

.status-badge {
    padding: 4px 12px;
    background: #333;
    color: #aaa;
    border-radius: 4px;
    font-size: 12px;
}

/* 材质项（新增：按材质分组） */

.material-item {
    background: #2a2a2a;
    border-radius: 6px;
    border: 1px solid #333;
    overflow: hidden;
    transition: all 0.2s ease;
}

.material-item.expanded {
    border-color: #4a9eff;
}

.material-header {
    padding: 16px;
    cursor: pointer;
    user-select: none;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.material-header:hover {
    background: #333;
}

.material-info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-view-properties {
    padding: 6px 12px;
    background: #4a9eff;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-view-properties:hover {
    background: #5fadff;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(74, 158, 255, 0.3);
}

.btn-view-properties:active {
    transform: translateY(0);
}

.material-match-info {
    color: #4a9eff;
    font-size: 13px;
}

.material-stats {
    color: #888;
    font-size: 13px;
}

.material-content {
    border-top: 1px solid #333;
    padding: 16px;
    background: #222;
}

.usage-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.usage-model-group {
    background: #2a2a2a;
    border-radius: 4px;
    padding: 12px;
    border: 1px solid #333;
}

.usage-model-name {
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid #333;
}

.usage-mesh-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.usage-mesh-item {
    padding: 6px 12px;
    background: #1a1a1a;
    border-radius: 3px;
    border-left: 3px solid #4a9eff;
}

.usage-mesh-item .mesh-name {
    color: #ccc;
    font-size: 13px;
}

/* 切换开关 */

.toggle-switch {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.toggle-switch input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-switch label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    user-select: none;
    position: relative;
    padding-left: 60px;
    min-height: 30px;
}

.toggle-switch label::before {
    content: '';
    position: absolute;
    left: 0;
    width: 54px;
    height: 28px;
    background: #444;
    border-radius: 14px;
    transition: all 0.3s ease;
    border: 2px solid #555;
}

.toggle-switch label::after {
    content: '';
    position: absolute;
    left: 3px;
    top: 50%;
    transform: translateY(-50%);
    width: 22px;
    height: 22px;
    background: #888;
    border-radius: 50%;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.toggle-switch input[type="checkbox"]:checked + label::before {
    background: #4a9eff;
    border-color: #4a9eff;
}

.toggle-switch input[type="checkbox"]:checked + label::after {
    left: 29px;
    background: #fff;
}

.toggle-label-off,
.toggle-label-on {
    font-size: 13px;
    color: #ccc;
    transition: all 0.2s ease;
    display: inline-block;
    min-width: 100px;
    text-align: left;
}

.toggle-switch input[type="checkbox"]:not(:checked) + label .toggle-label-on {
    display: none;
}

.toggle-switch input[type="checkbox"]:checked + label .toggle-label-off {
    display: none;
}

.toggle-switch input[type="checkbox"]:checked + label .toggle-label-on {
    color: #4a9eff;
    font-weight: 500;
}

/* 按钮样式 */

.btn {
    padding: 10px 24px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: #4a9eff;
    color: #fff;
}

.btn-primary:hover:not(:disabled) {
    background: #3a8eef;
    box-shadow: 0 4px 12px rgba(74, 158, 255, 0.3);
}

.btn-secondary {
    background: #444;
    color: #fff;
}

.btn-secondary:hover:not(:disabled) {
    background: #555;
}

/* Toast 提示样式 */

.upload-toast {
    display: flex;
    align-items: center;
    gap: 10px;
}

.toast-icon {
    font-size: 20px;
    line-height: 1;
}

.toast-message {
    font-size: 14px;
    line-height: 1.4;
}

/* Toast 动画 */

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translate(-50%, -20px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

@keyframes slideUp {
    from {
        opacity: 1;
        transform: translate(-50%, 0);
    }
    to {
        opacity: 0;
        transform: translate(-50%, -20px);
    }
}

/* 进度条样式 */

.upload-progress-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease-out;
}

.upload-progress-container {
    background: linear-gradient(135deg, #1a1f2e 0%, #2a2a2a 100%);
    border-radius: 16px;
    padding: 40px;
    min-width: 500px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    border: 1px solid #4a9eff;
}

.progress-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 30px;
}

.progress-icon {
    font-size: 48px;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

.progress-title {
    margin: 0;
    color: #fff;
    font-size: 24px;
    font-weight: 600;
}

.progress-bar-wrapper {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.progress-bar {
    flex: 1;
    height: 32px;
    background: #1a1a1a;
    border-radius: 16px;
    overflow: hidden;
    border: 2px solid #333;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #4a9eff 0%, #667eea 100%);
    border-radius: 14px;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 20px rgba(74, 158, 255, 0.5);
    position: relative;
    overflow: hidden;
}

.progress-bar-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

.progress-percentage {
    color: #4a9eff;
    font-size: 24px;
    font-weight: 700;
    min-width: 70px;
    text-align: right;
}

.progress-status {
    color: #aaa;
    font-size: 16px;
    text-align: center;
    padding: 12px;
    background: rgba(42, 42, 42, 0.6);
    border-radius: 8px;
    border: 1px solid #333;
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

